package com.share.hello;

import com.fasterxml.jackson.core.Versioned;
import com.fasterxml.jackson.databind.ObjectMapper;
import com.share.hello.model.Book;

/**
 * @author caifan
 * @created 2021/12/16
 * @description:
 */
public class Main01 {

    public static void main(String[] args) throws Exception {
        Book modularityBook = new Book();
        modularityBook.setName("java9");
        ObjectMapper mapper = new ObjectMapper();
        String json = mapper.writeValueAsString(modularityBook);
        System.out.println(json);

        Versioned versioned = mapper;
        System.out.println(versioned.version());
    }
}
